package com.by.controller;

import com.by.bean.Goods;
import com.by.remote.GoodsRemoteClient;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class GoodsController implements GoodsRemoteClient {

    @Override
    public String update(int goodsId, int num) {
        System.out.println("更新库存:goodsId="+goodsId+"&num="+num);
        return "更新成功";
    }


    @Override
    public String updateEntity(Map map) {
        System.out.println("----");
        return "ok";
    }

    @Override
    public Map get(int id) {
        System.out.println("请求id==="+id);
        Map map=new HashMap();
        map.put("id",id);
        map.put("name","华为手机");
        return map;
    }

    @Override
    public int save(Goods goods) {
        System.out.println("----");
        return 1;
    }
}
